<template>
  <lazy-component class="zui-pt-10px zui-px-10px zui-background-color-white">
    <van-swipe :autoplay="3000">
      <van-swipe-item v-for="(item, index) in value" :key="index">
        <z-image @click="handleLink(item.path)" :src="item.src" width="100%" height="calc((100vw - 20px) * .6)"></z-image>
      </van-swipe-item>
    </van-swipe>
  </lazy-component>
</template>

<script>
/**
 * 首页上面的轮播组件
 * @param { array } - value内容数组，[{ src: src, path: path }, { src: src, path: path }]
 */
export default {
  name: 'MainSwipe',
  props: {
    value: Array
  },
  methods: {
    handleLink (path) {
      console.log('跳转')
      this.$router.push({
        path: path
      })
    }
  }
}
</script>
